import { createApp } from "vue";
import App from "./App.vue";
import actions from "./shared/actions";

let app;
function render(props) {
  app = createApp(App);
  const { container } = props;

  app.mount(container ? container.querySelector("#app") : "#app");
}

// 独立运行时
if (!window.__POWERED_BY_QIANKUN__) {
  render({});
}

// +++++需要暴露接入协议
export async function bootstrap() {
  console.log("vue3 app bootstraped");
}
export async function mount(props) {
  console.log(props);
  console.log("vue3 app mount");
  actions.setActions(props);
  render(props);
}
export async function unmount() {
  console.log("vue3 app unmount");
}
